package com.example.demo.dao;

import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.example.demo.GenericDao;
import com.example.demo.model.SysRoleModel;


public interface RoleDao  extends GenericDao<SysRoleModel,String> {  //extends JpaRepository<SysRoleModel,Integer>  {
	
//	Page<SysRoleModel> findAll(Pageable pageable);
//	
//	Page<SysRoleModel> findByRoleNameLike(String string, Pageable pageable);
//	
//	
//	@Query("select sum(id) from sysRole group by id ")
//	public List<String> sumRole();
//	 
//	 
//	@Query("from sysRole u where u.roleName=:roleName")
//	List<SysRoleModel> findRole(@Param("roleName") String roleName);
//	
// 
//	
//	@Query(value = "from sysRole  where roleName like %:roleName%")
//	List<SysRoleModel> findByHql(@Param("roleName") String roleName);
//	
//	
//	@Query(value = "select * from sys_role b where b.role_name like %?1%", nativeQuery = true)
//	List<SysRoleModel> findRoleLikeBySql(String roleName);
//	
//	@Query(value = "select * from sys_role b where b.role_name=?1", nativeQuery = true)
//	List<SysRoleModel> findRoleBySql(String roleName);
//	
//	
//	@Query("select id from sysRole role inner join sysRoleResource rr  on  role.id = rr.roleId  where rr.roleId = ?1")
//    Page<SysRoleModel> findByRole(String roleId, Pageable pageable);

	List<SysRoleModel> queryRoleList();

	List<SysRoleModel> queryRoleByHql();

	List<SysRoleModel> queryRoleListByHql();
	
	
	
	
	
	
}